package cn.xinfei.xdecision.common.model.datax.enums;

import lombok.Getter;

public enum ExecutorType implements ICodeEnum {
    /**
     * 同步
     */
    SYNC("S"),
    /**
     * 异步
     */
    ASYNC("A");

    @Getter
    public final String code;

    ExecutorType(String code) {
        this.code = code;
    }

    public static ExecutorType fromIsSyncCode(Integer isSyncCode) {
        return null == isSyncCode ? ExecutorType.SYNC :
                isSyncCode == 1 ? ExecutorType.SYNC :
                        isSyncCode == 0 ? ExecutorType.ASYNC : ExecutorType.SYNC;
    }
}
